﻿using MobileBSC_Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace MobileBSC_Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IMobileBSC" in both code and config file together.
    [ServiceContract]
    public interface IMobileBSC
    {
        [OperationContract]
        [WebGet(UriTemplate="/perspectives")]
        List<Perspective> GetPerspectives();

        [OperationContract]
        [WebGet(UriTemplate = "/perspectives?id={id}")]
        Perspective GetPerspective(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/goals")]
        List<StrategicGoal> GetGoals();

        [OperationContract]
        [WebGet(UriTemplate = "/goals?id={id}")]
        StrategicGoal GetGoal(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/goals/perspective?id={id}")]
        List<StrategicGoal> GetPerspectiveGoals(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/goals/referencedBy?id={id}")]
        List<GoalReferenceMap> GetReferencedGoals(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/kpis")]
        List<KPI> GetKPIs();

        [OperationContract]
        [WebGet(UriTemplate = "/kpis?id={id}")]
        KPI GetKPI(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/kpis/goal?id={id}")]
        List<GoalValueMap> GetGoalKPIs(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/kpis/weaksignal?id={id}")]
        List<SignalAssociationMap> GetSignalKPIs(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/weaksignals")]
        List<WeakSignal> GetWeakSignals();

        [OperationContract]
        [WebGet(UriTemplate = "/weaksignals?id={id}")]
        WeakSignal GetWeakSignal(string id);

        [OperationContract]
        [WebGet(UriTemplate = "/weaksignals/kpi?id={id}")]
        List<SignalAssociationMap> GetKPISignals(string id);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/weaksignals/write")]
        void WriteWeakSignal(WeakSignal signal);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/signalassociation/write")]
        void WriteSignalAssociation(SignalAssociationMap map);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "/signalassociation/delete")]
        void DeleteSignalAssociation(SignalAssociationMap map);
    }
}
